package com.feiyu.sys.service

import org.junit.Test
import org.junit.runner.RunWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner

/**
 * Created by zdy on 2017/11/24.
 */
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
class LoginUserServiceTest extends GroovyTestCase {

    @Autowired
    LoginUserService userService


    @Test
    void testGetList() {
        List<LoginUser> userList = userService.getList()
        assertNotNull(userList)
    }

    @Test
    void testGetUserById() {
    }

    @Test
    void testAddUser() {
        LoginUser user = new LoginUser("test", "test")
        userService.addUser(user)
        assertEquals("test", userService.getUserByName("test").login_name)
    }
}
